package org.korosoft.rusalad.syncnrun.cli;

import org.apache.commons.cli.CommandLine;
import org.korosoft.rusalad.syncnrun.Client;
import org.korosoft.rusalad.syncnrun.command.PingCmd;

/**
 * Sends PING request to remote server.
 *
 * @author Dmitry Korotkov
 * @since 1.0
 */
public class CliPing extends CliClientCommand {
    public CliPing() {
        super("ping", "Sends ping request to the server.");
        addCommonLoggingOpts();
    }

    @Override
    protected int doExecute(Client client, CommandLine commandLine) throws Exception {
        client.execCommandSynchronously(new PingCmd());
        return 0;
    }
}
